<?php

namespace Admin\Model;
use Think\Model;

/**
 * 试卷模型
 * @author zhiyuan
 *
 */

class PapersModel extends Model {
	
	protected $_validate = array(
			array('name', 'require', '名称不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
			array('mastertitle', 'require', '主标题不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
			array('secondtitle', 'require', '副标题不能为空', self::MUST_VALIDATE, 'regex', self::MODEL_BOTH),
			array('score','10,200','总分范围为10~150',self::MUST_VALIDATE,'between',self::MODEL_BOTH),
			array('sets','1,127','总分范围为1~127',self::MUST_VALIDATE,'between',self::MODEL_BOTH)
	);
	
	protected $_auto = array(
			array('owner', UID, self::MODEL_BOTH),
			array('create_time', NOW_TIME, self::MODEL_INSERT),
			array('update_time', NOW_TIME, self::MODEL_BOTH),
			array('status', '1', self::MODEL_INSERT)
	);

}
?>
